import timeit


def main():
    class Solution:
        def __init__(self):
            self.numroom = {
                0: "",
                1: "I",
                2: "II",
                3: "III",
                4: "IV",
                5: "V",
                6: "VI",
                7: "VII",
                8: "VIII",
                9: "IX",
            }

        def intToRoman(self, num):
            """
            :type num: int
            :rtype: str
            """
            numposition = self.getposition(num)
            method_name = "getnumber_" + str(numposition)
            method = getattr(self, method_name, lambda: "nothing")
            ret = method(num)
            return ret

        def getposition(self, num):
            numlen = len(str(num))
            return numlen

        def getnumber_1(self, num):
            return self.numroom[num]

        def getnumber_2(self, num):
            a, b = divmod(num, 10)
            a = self.getnumber_1(a).replace("X", "C").replace("V", "L").replace("I", "X")
            b = self.getnumber_1(b)
            return a + b

        def getnumber_3(self, num):
            a, b = divmod(num, 100)
            a = a = self.getnumber_1(a).replace("I", "C").replace("V", "D").replace("X","M")
            b = self.getnumber_2(b)
            return a + b

        def getnumber_4(self, num):
            a, b = divmod(num, 1000)
            a = a = self.getnumber_1(a).replace("I", "M")
            b = self.getnumber_3(b)
            return a + b

    ex = [i for i in range(1, 4000)]
    s = Solution()
    # for i in ex:
    ret = s.intToRoman(3999)
    print(str(90) + ":" + ret)


if __name__ == '__main__':
    t1 = timeit.timeit(stmt=main, number=1)
    print(t1)
